<template>
  <div id="app">
    <transition name="router-fade" mode="out-in">
      <keep-alive v-if="$route.meta.keepAlive">
        <router-view></router-view>
      </keep-alive>
    </transition>
    <transition name="router-fade" mode="out-in">
      <router-view v-if="!$route.meta.keepAlive"></router-view>
    </transition>
  </div>
</template>

<script>
export default {
  name: "App",
  created() {
    const url = new URL(window.location.href);
    const params = new URLSearchParams(url.search);
    localStorage.setItem("appId", params.get("appId"));
    localStorage.setItem("token", params.get("token"));
  }
};
</script>

<style>
#app {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #fff;
}
.router-fade-enter-active {
  transition: opacity 1s;
}

 .router-fade-enter, .router-fade-leave-active {
   opacity: 0.8;
 }
</style>
